list = [
	'zytrap',
	'zyswitch',
	'-1',
	'-1',
	'0',
	'0',
	'GigabitEthernet1/0/1:',
	'GigabitEthernet1/0/5:',
	'Pos2/0/1',
	'POS6/2',
	'Vlan-interface4000',
	'Vlanif2006',
	'GigabitEthernet8/0/5.2301',
	'GigabitEthernet2/0/1.4',
	'GigabitEthernet8/0/5',
	'Ethernet12/0/2',
	'Eth-Trunk1.2124',
	'59.48.56.246',
	'59.48.70.26',
	'sxnoc'
]
def val
def matcher
def regex = /^\D+(\d+)(\/(\d+))?(\/(\d+))?(\D+)?(\d+)?$/
pattern = ~regex
list.each { str ->
	if (str != '-1' && str != '0' && str != null && str != '') {
		matcher = str =~ regex
		if(matcher.size() > 0){
			println matcher[0]
			if (matcher[0][2]) { // GigabitEthernet2/0/1.4 -> 1
				val = matcher[0][5]
			} else { // Vlanif2006 -> 2006
				val = matcher[0][1]
			}
		}
	}
	println str + ' -> ' + val
	val = ''
}


//------------------Vlanif2006 -> 2006, GigabitEthernet2/0/1.4 -> 2/0/1--------------------------
/*
def val
def matcher
def regex = /^\D+((\d+)(\/(\d+))?(\/(\d+))?)(\D+)?(\d+)?$/
pattern = ~regex
list.each { str ->
	if (str != '-1' && str != '0' && str != null && str != '') {
		matcher = str =~ regex
		if(matcher.size() > 0){
			println matcher[0]
			 // Vlanif2006 -> 2006, GigabitEthernet2/0/1.4 -> 2/0/1
			val = matcher[0][1]
		}
	}
	println str + ' -> ' + val
	val = ''
}
*/